﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class App_MasterPages_AdminMasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
            UsernameLabel.Text = string.Format("{0} به سیستم خوش آمدید!", Profile.UserName);
        if (Profile.IsAnonymous)
            Response.Redirect("~/Default.aspx");
    }
    protected void LogoutImageButton_Click(object sender, ImageClickEventArgs e)
    {
        Session.Abandon();
        FormsAuthentication.SignOut();
        Response.Redirect("~/Default.aspx");
    }
}
